//
//  UITextViewMove.m
//  CoinDemo
//
//  Created by Hello Word on 16/5/9.
//  Copyright © 2016年 com.YuanBaoCoin. All rights reserved.
//

#import "UITextViewMove.h"
#define MoveHeight 15
@implementation UITextViewMove


+(void)textFieldDidBeginEditing:(UITextField *)textField View:(UIView *)view{
    
    //设置动画的名字
    [UIView beginAnimations:@"Animation" context:nil];
    //设置动画的间隔时间
    [UIView setAnimationDuration:0.20];
    //??使用当前正在运行的状态开始下一段动画
    [UIView setAnimationBeginsFromCurrentState: YES];
    //设置视图移动的位移
    view.frame = CGRectMake(view.frame.origin.x, view.frame.origin.y - MoveHeight, view.frame.size.width, view.frame.size.height);
    //设置动画结束
    [UIView commitAnimations];
    
    
}

//在UITextField 编辑完成调用方法
+(void)textFieldDidEndEditing:(UITextField *)textField view:(UIView *)view
{
    //设置动画的名字
    [UIView beginAnimations:@"Animation" context:nil];
    //设置动画的间隔时间
    [UIView setAnimationDuration:0.20];
    //??使用当前正在运行的状态开始下一段动画
    [UIView setAnimationBeginsFromCurrentState: YES];
    //设置视图移动的位移
    view.frame = CGRectMake(view.frame.origin.x, view.frame.origin.y + MoveHeight, view.frame.size.width, view.frame.size.height);
    //设置动画结束
    [UIView commitAnimations];
}




@end
